-- ----------------------------- 2023-07-07 add by zhoujq--------------begin

-- 建表语句
CREATE TABLE T_LIMS_TEST_PACKAGE( 
    ID NUMBER NOT NULL,
    PACKAGECODE VARCHAR2(100)  NULL,
    PACKAGENAME VARCHAR2(200)  NULL,
    PACKAGETYPE VARCHAR2(50)  NULL,
    PRICE VARCHAR2(50)  NULL,
    STATUS VARCHAR2(5)  NULL,
    CREATEDBYID VARCHAR2(36)  NULL,
    CREATEDBYNAME VARCHAR2(60)  NULL,
    CREATEDTIME DATE NULL,
    CREATEDBYORGID VARCHAR2(36)  NULL,
    CREATEDBYORGNAME VARCHAR2(270)  NULL
 );
COMMENT ON TABLE T_LIMS_TEST_PACKAGE IS '检测套餐';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE.ID IS '主键';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE.PACKAGECODE IS '套餐编码';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE.PACKAGENAME IS '套餐名称';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE.PACKAGETYPE IS '套餐类别';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE.PRICE IS '套餐价格';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE.STATUS IS '启用状态';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE.CREATEDBYID IS '制单人编码';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE.CREATEDBYNAME IS '制单人名称';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE.CREATEDTIME IS '制单时间';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE.CREATEDBYORGID IS '制单人单位编码';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE.CREATEDBYORGNAME IS '制单人单位名称';

ALTER TABLE T_LIMS_TEST_PACKAGE ADD CONSTRAINT PK_LIMS_TEST_PACKAGE PRIMARY KEY (ID);

-- 旧版审计跟踪，跟踪配置变更语句

INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','ID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','PACKAGECODE','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','PACKAGENAME','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','PACKAGETYPE','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','PRICE','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','STATUS','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','CREATEDBYID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','CREATEDBYNAME','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','CREATEDTIME','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','CREATEDBYORGID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','CREATEDBYORGNAME','1',CURRENT_TIMESTAMP);
COMMIT;

-- 审计跟踪V2，跟踪配置变更语句

INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','ID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','PACKAGECODE','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','PACKAGENAME','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','PACKAGETYPE','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','PRICE','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','STATUS','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','CREATEDBYID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','CREATEDBYNAME','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','CREATEDTIME','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','CREATEDBYORGID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE','CREATEDBYORGNAME','1');
COMMIT;
CREATE TABLE T_LIMS_TEST_PACKAGE_PRODUCT( 
    ID NUMBER NOT NULL,
    PACKAGEID NUMBER NULL,
    PRODUCTMAINID NUMBER NULL,
    CREATEDBYID VARCHAR2(36)  NULL,
    CREATEDBYNAME VARCHAR2(60)  NULL,
    CREATEDTIME DATE NULL,
    CREATEDBYORGID VARCHAR2(36)  NULL,
    CREATEDBYORGNAME VARCHAR2(270)  NULL
 );
COMMENT ON TABLE T_LIMS_TEST_PACKAGE_PRODUCT IS '检测套餐项目';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE_PRODUCT.ID IS '主键';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE_PRODUCT.PACKAGEID IS '套餐id';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE_PRODUCT.PRODUCTMAINID IS '检测项目id';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE_PRODUCT.CREATEDBYID IS '制单人编码';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE_PRODUCT.CREATEDBYNAME IS '制单人名称';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE_PRODUCT.CREATEDTIME IS '制单时间';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE_PRODUCT.CREATEDBYORGID IS '制单人单位编码';
COMMENT ON COLUMN T_LIMS_TEST_PACKAGE_PRODUCT.CREATEDBYORGNAME IS '制单人单位名称';

ALTER TABLE T_LIMS_TEST_PACKAGE_PRODUCT ADD CONSTRAINT PK_LIMS_TEST_PACKAGE_PRODUCT PRIMARY KEY (ID);

-- 旧版审计跟踪，跟踪配置变更语句

INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE_PRODUCT','ID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE_PRODUCT','PACKAGEID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE_PRODUCT','PRODUCTMAINID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE_PRODUCT','CREATEDBYID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE_PRODUCT','CREATEDBYNAME','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE_PRODUCT','CREATEDTIME','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE_PRODUCT','CREATEDBYORGID','1',CURRENT_TIMESTAMP);
INSERT INTO T_CORE_AT_CONFIG_LINE (ID,CONFIGID,COLUMNID,AUDITTRAIL,CREATEDTIME) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE_PRODUCT','CREATEDBYORGNAME','1',CURRENT_TIMESTAMP);
COMMIT;

-- 审计跟踪V2，跟踪配置变更语句

INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE_PRODUCT','ID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE_PRODUCT','PACKAGEID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE_PRODUCT','PRODUCTMAINID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE_PRODUCT','CREATEDBYID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE_PRODUCT','CREATEDBYNAME','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE_PRODUCT','CREATEDTIME','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE_PRODUCT','CREATEDBYORGID','1');
INSERT INTO T_CORE_AUDIT_CONFIG_COLUMN (ID,CONFIGID,"COLUMN",AUDITABLE) VALUES (SEQ_CORE.NEXTVAL,'T_LIMS_TEST_PACKAGE_PRODUCT','CREATEDBYORGNAME','1');
COMMIT;
CALL INSERTI18N('T_LIMS_TEST_PACKAGE.SERVICE_NAME', '检测套餐', '检测套餐', 'zh-CN', '检测套餐');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE.ID', '检测套餐的主键', '主键', 'zh-CN', '主键');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE.PACKAGECODE', '检测套餐的套餐编码', '套餐编码', 'zh-CN', '套餐编码');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE.PACKAGENAME', '检测套餐的套餐名称', '套餐名称', 'zh-CN', '套餐名称');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE.PACKAGETYPE', '检测套餐的套餐类别', '套餐类别', 'zh-CN', '套餐类别');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE.PRICE', '检测套餐的套餐价格', '套餐价格', 'zh-CN', '套餐价格');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE.STATUS', '检测套餐的启用状态', '启用状态', 'zh-CN', '启用状态');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE.CREATEDBYID', '检测套餐的制单人编码', '制单人编码', 'zh-CN', '制单人编码');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE.CREATEDBYNAME', '检测套餐的制单人名称', '制单人名称', 'zh-CN', '制单人名称');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE.CREATEDTIME', '检测套餐的制单时间', '制单时间', 'zh-CN', '制单时间');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE.CREATEDBYORGID', '检测套餐的制单人单位编码', '制单人单位编码', 'zh-CN', '制单人单位编码');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE.CREATEDBYORGNAME', '检测套餐的制单人单位名称', '制单人单位名称', 'zh-CN', '制单人单位名称');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE_PRODUCT.SERVICE_NAME', '检测套餐项目', '检测套餐项目', 'zh-CN', '检测套餐项目');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE_PRODUCT.ID', '检测套餐项目的主键', '主键', 'zh-CN', '主键');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE_PRODUCT.PACKAGEID', '检测套餐项目的套餐id', '套餐id', 'zh-CN', '套餐id');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE_PRODUCT.PRODUCTMAINID', '检测套餐项目的检测项目id', '检测项目id', 'zh-CN', '检测项目id');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE_PRODUCT.CREATEDBYID', '检测套餐项目的制单人编码', '制单人编码', 'zh-CN', '制单人编码');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE_PRODUCT.CREATEDBYNAME', '检测套餐项目的制单人名称', '制单人名称', 'zh-CN', '制单人名称');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE_PRODUCT.CREATEDTIME', '检测套餐项目的制单时间', '制单时间', 'zh-CN', '制单时间');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE_PRODUCT.CREATEDBYORGID', '检测套餐项目的制单人单位编码', '制单人单位编码', 'zh-CN', '制单人单位编码');
CALL INSERTI18N('T_LIMS_TEST_PACKAGE_PRODUCT.CREATEDBYORGNAME', '检测套餐项目的制单人单位名称', '制单人单位名称', 'zh-CN', '制单人单位名称');
CALL INSERTI18N('BASEMODULE.COREDATA.PJPRODUCTPACKAGES.MODAL.ADD', '新增', '新增', 'zh-CN', '新增');
CALL INSERTI18N('BASEMODULE.COREDATA.PJPRODUCTPACKAGES.TAB.BASE_INFO', '基本信息', '基本信息', 'zh-CN', '基本信息');
CALL INSERTI18N('BASEMODULE.COREDATA.PJPRODUCTPACKAGES.BUTTON.BUTTON', '按钮', '按钮', 'zh-CN', '按钮');
CALL INSERTI18N('BASEMODULE.COREDATA.PJPRODUCTPACKAGES.TIP.TIP', '提示框', '提示框', 'zh-CN', '提示框');
CALL INSERTI18N('BASEMODULE.COREDATA.PJPRODUCTPACKAGES.MODAL.MODAL', '对话框', '对话框', 'zh-CN', '对话框');

-- 创建菜单语句
INSERT INTO T_CORE_MENU (ID, MENUNAME, HREF, PARENTID, ORDERNO, ICON, MENUINITNAME)
VALUES ('2023070701', '普检检测套餐', '/secure/basemodule/coredata/test-package-products/page/edit-list', 'null', '2023070701', 'null', '普检检测套餐');

INSERT INTO T_CORE_TABLE (ID, AUDITABLE, ATTACHMENT)
VALUES ('T_LIMS_TEST_PACKAGE', '0', '0');
INSERT INTO T_CORE_TABLE (ID, AUDITABLE, ATTACHMENT)
VALUES ('T_LIMS_TEST_PACKAGE_PRODUCT', '0', '0');


COMMIT;

-- ----------------------------- 2023-07-07 add by zhoujq------------end